<template>
	<view class="content">
		<view class="text" v-if="id == 1"><u-parse :html="content"></u-parse></view>
		<view class="text" v-if="id == 2"><u-parse :html="content1"></u-parse></view>
		<view class="text" v-if="id == 3"><u-parse :html="content2"></u-parse></view>
		<view class="text" v-if="id == 4"><u-parse :html="content3"></u-parse></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			id: '',
			content: '',
			content1: '',
			content2: '',
			content3: '',
		};
	},
	onLoad(id) {
		this.id = id.id;
		
		this.protocol();
	},

	methods: {
		async protocol() {
			let obj = {};
			const res = await this.$u.post('api/set/agreement ', obj, {});
			
			this.content = res.data[0].content;
			this.content1 = res.data[1].content;
			this.content2 = res.data[2].content;
			this.content3 = res.data[3].content;
			if (this.id == 1) {
				uni.setNavigationBarTitle({
					title: res.data[0].title
				});
			} else if(this.id == 2)  {
				uni.setNavigationBarTitle({
					title: res.data[1].title
				});
			}else if (this.id == 3) {
				uni.setNavigationBarTitle({
					title: res.data[2].title
				});
			} else {
				uni.setNavigationBarTitle({
					title: res.data[3].title
				});
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.content {
	width: 100vw;
	height: 100vh;
	overflow: scroll;
	background-color: #1b1b1b;
	padding: 40rpx 32rpx;
	.text {
		color: #ffffff;
		font-size: 30rpx;
	}
}
</style>
